<html lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Docking Code</title>
    <meta name="description" content="这是一个 index 页面">
    <meta name="keywords" content="index">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <link rel="icon" type="image/png" href="/static/i/favicon.png">
    <link rel="apple-touch-icon-precomposed" href="/static/i/app-icon72x72@2x.png">
    <meta name="apple-mobile-web-app-title" content="Amaze UI"/>
    <link rel="stylesheet" href="/static/css/amazeui.min.css"/>
    <link rel="stylesheet" href="/static/css/app.css">
    <link rel="stylesheet" href="/static/css/amazeui.datatables.min.css"/>


    <link href="/static/css/css/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>
    <link href="/static/css/css/plugins/simple-line-icons/simple-line-icons.min.css" rel="stylesheet" type="text/css"/>
    <link href="/static/css/css/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
    <link href="/static/css/css/plugins/bootstrap-switch/css/bootstrap-switch.min.css" rel="stylesheet"
          type="text/css"/>
    <!-- END GLOBAL MANDATORY STYLES -->
    <!-- BEGIN PAGE LEVEL PLUGINS -->
    <link href="/static/css/css/plugins/select2/css/select2.min.css" rel="stylesheet" type="text/css"/>
    <link href="/static/css/css/plugins/select2/css/select2-bootstrap.min.css" rel="stylesheet" type="text/css"/>
    <link rel="stylesheet" href="/static/css/amazeui.upload.css">
    <link rel="stylesheet" href="/static/css/css/plugins/bootstrap-timepicker/css/bootstrap-timepicker.min.css" />
    <link rel="stylesheet" href="/static/css/css/plugins/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css" />
    <link rel="stylesheet" href="/static/css/css/plugins/bootstrap-datepicker/css/bootstrap-datepicker3.min.css" />
    <link rel="stylesheet" href="/static/css/css/plugins/bootstrap-daterangepicker/daterangepicker.min.css" />
    <link rel="stylesheet" href="/static/css/css/plugins/clockface/css/clockface.css" />
    <!-- END PAGE LEVEL PLUGINS -->
    <!-- BEGIN THEME GLOBAL STYLES -->
    <link href="/static/css/css/components.min.css" rel="stylesheet" id="style_components" type="text/css"/>
    <link href="/static/css/css/plugins.min.css" rel="stylesheet" type="text/css"/>
    <!-- END THEME GLOBAL STYLES -->
    <!-- BEGIN THEME LAYOUT STYLES -->
    <link href="/static/css/css/layout/css/layout.min.css" rel="stylesheet" type="text/css"/>
    <link href="/static/css/css/layout/css/themes/darkblue.min.css" rel="stylesheet" type="text/css" id="style_color"/>
    <link href="/static/css/css/layout/css/custom.min.css" rel="stylesheet" type="text/css"/>
    <script src="/static/js/jquery.min.js"></script>
</head>
<body class="theme-white">
<div class="am-g tpl-g" id="form_wizard_1">
    <div class="portlet-body form">
        <form class="form-horizontal" action="#" id="submit_form" method="POST" novalidate="novalidate">
            <div class="form-wizard">
                <div class="form-body">
                    <ul class="nav nav-pills nav-justified steps">
                        <li class="active">
                            <a href="#tab1" data-toggle="tab" class="step" aria-expanded="true">
                                <span class="number"> 1 </span>
                                <span class="desc">
                                                                    <i class="fa fa-check"></i> 创建控制器 </span>
                            </a>
                        </li>
                        <li>
                            <a href="#tab2" data-toggle="tab" class="step">
                                <span class="number"> 2 </span>
                                <span class="desc">
                                                                    <i class="fa fa-check"></i> 创建模型 </span>
                            </a>
                        </li>
                        <li>
                            <a href="#tab3" data-toggle="tab" class="step active">
                                <span class="number"> 3 </span>
                                <span class="desc">
                                                                    <i class="fa fa-check"></i> 创建视图 </span>
                            </a>
                        </li>
                        <li>
                            <a href="#tab4" data-toggle="tab" class="step">
                                <span class="number"> 4 </span>
                                <span class="desc">
                                                                    <i class="fa fa-check"></i> 完成 </span>
                            </a>
                        </li>
                    </ul>
                    <div id="bar" class="progress progress-striped" role="progressbar">
                        <div class="progress-bar progress-bar-success" style="width: 25%;"></div>
                    </div>
                    <div class="tab-content">
                        <div class="alert alert-success display-none">
                            <button class="close" data-dismiss="alert"></button>
                            Your form validation is successful!
                        </div>
                        <div class="tab-pane active" id="tab1">
                            <div class="form-group">
                                <label class="control-label col-md-3" >返修日期
                                    <span class="required" aria-required="true"> * </span>
                                </label>
                                <div class="col-md-4">
                                    <input type="text" data-date-format="yyyy-mm-dd" class="form-control form-control-inline input-medium date-picker" name="CreateDate">
                                    <!--<span class="help-block"> Provide your username </span>-->
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-md-3">设备编号
                                    <span class="required" aria-required="true"> * </span>
                                </label>
                                <div class="col-md-4">
                                    <input type="text" class="form-control" name="DeviceId">
                                    <!--<span class="help-block"> Provide your email address </span>-->
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-md-3">属性
                                    <span class="required" aria-required="true"> * </span>
                                </label>
                                <div class="col-md-4">
                                    <div class="clearfix">
                                        <div class="btn-group" data-toggle="buttons">
                                            <label class="btn blue active">
                                                <input type="radio" class="toggle" value="TCL">TCL</label>
                                            <label class="btn blue">
                                                <input type="radio" class="toggle" value="警翼">警翼</label>
                                            <label class="btn blue">
                                                <input type="radio" class="toggle" value="其他">其他</label>
                                        </div>
                                    </div>
                                    <!--<span class="help-block"> Provide your email address </span>-->
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-md-3">故障类型
                                    <span class="required" aria-required="true"> * </span>
                                </label>
                                <div class="col-md-4">
                                    <div style="margin-left:0px;" class="form-group">
                                        <div class="input-group select2-bootstrap-append">
                                            <select id="single-append-text" class="form-control select2-allow-clear">
                                                <option></option>
                                                <option value="外壳">外壳</option>
                                                <option value="存储">存储</option>
                                                <option value="死机">死机</option>
                                                <option value="程序&底座">程序&底座</option>
                                                <option value="屏幕&底座">屏幕&底座</option>
                                                <option value="按键&底座">按键&底座</option>
                                                <option value="屏幕&存储">屏幕&存储</option>
                                                <option value="开关机&底座">开关机&底座</option>
                                                <option value="其他">其他</option>
                                            </select>
                                            <span class="input-group-btn">
                                                    <button class="btn btn-default" style="padding-top:10px;padding-bottom:9px;" type="button" data-select2-open="single-append-text">
                                                        <span class="glyphicon glyphicon-search"></span>
                                                    </button>
                                                </span>
                                        </div>
                                    </div>
                                    <!--<span class="help-block"> Provide your email address </span>-->
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-md-3">故障详情
                                    <span class="required" aria-required="true"> * </span>
                                </label>
                                <div class="col-md-4">
                                    <input type="text" class="form-control" name="DeviceTroubleDetails">
                                    <!--<span class="help-block"> Provide your email address </span>-->
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-md-3">警员
                                    <span class="required" aria-required="true"> * </span>
                                </label>
                                <div class="col-md-4">
                                    <input type="text" class="form-control" name="Police">
                                    <!--<span class="help-block"> Provide your email address </span>-->
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-md-3">警号
                                    <span class="required" aria-required="true"> * </span>
                                </label>
                                <div class="col-md-4">
                                    <input type="text" class="form-control" name="PoliceId">
                                    <!--<span class="help-block"> Provide your email address </span>-->
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-md-3">所属大队
                                    <span class="required" aria-required="true"> * </span>
                                </label>
                                <div class="col-md-4">
                                    <input type="text" class="form-control" name="Dept">
                                    <!--<span class="help-block"> Provide your email address </span>-->
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-md-3">部门
                                    <span class="required" aria-required="true"> * </span>
                                </label>
                                <div class="col-md-4">
                                    <input type="text" class="form-control" name="Unit">
                                    <!--<span class="help-block"> Provide your email address </span>-->
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-md-3">备机
                                    <span class="required" aria-required="true"> * </span>
                                </label>
                                <div class="col-md-4">
                                    <input type="text" class="form-control" name="BackupId">
                                    <!--<span class="help-block"> Provide your email address </span>-->
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="control-label col-md-3">配件
                                    <span class="required" aria-required="true"> * </span>
                                </label>
                                <div class="col-md-4">
                                    <input type="text" class="form-control" name="Plugin">
                                    <!--<span class="help-block"> Provide your email address </span>-->
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-md-3">寄回日期
                                </label>
                                <div class="col-md-4">
                                    <input type="text" data-date-format="yyyy-mm-dd" class="form-control form-control-inline input-medium date-picker" name="ReceiveDeviceDate">
                                    <!--<span class="help-block"> Provide your email address </span>-->
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-md-3">备注
                                </label>
                                <div class="col-md-4">
                                    <input type="text" class="form-control" name="Comment">
                                    <!--<span class="help-block"> Provide your email address </span>-->
                                </div>
                            </div>
                            <div class="form-group">
                                <div id="event"></div>
                            </div>
                        </div>
                    </div>
                </div>
                <script>
                    var id = parent.$("#checkSdvId").val();

                    console.log(id);

                    if(id !== "") {
                        $.ajax({
                            type : 'GET',
                            url : '/sdvjson/getone?Id=' + id,
                            async : false,
                            success : function(data) {
                                $(" input[ name='CreateDate' ] ").val(data.CreateDate);
                                $(" input[ name='DeviceId']").val(data.DeviceId);
                                $(" input[ name='DeviceTroubleDetails']").val(data.DeviceTroubleDetails);
                                $(" input[ name='Police']").val(data.Police);
                                $(" input[ name='PoliceId']").val(data.PoliceId);
                                $(" input[ name='Dept']").val(data.Dept);
                                $(" input[ name='Unit']").val(data.Unit);
                                $(" input[ name='BackupId']").val(data.BackupId);
                                $(" input[ name='Plugin']").val(data.Plugin);
                                $(" input[ name='ReceiveDeviceDate']").val(data.ReceiveDeviceDate);
                                $(" input[ name='Comment']").val(data.Comment);
                                $("#single-append-text").val(data.DeviceTroubleType);
                                console.log(data.DeviceType);
                                $(".btn").filter(".blue").filter(".active").removeClass("active");
                                $(".btn-group").find("input").each(function(){
                                    if($(this).val() === data.DeviceType){
                                        $(this).parent().addClass("active");
                                    }
                                });
                            }
                        });
                    }
                </script>
                <div class="form-actions">
                    <div class="row">
                        <div class="col-md-offset-3 col-md-9">
                            <a href="javascript:;" class="btn btn-outline green button-next" onclick="clicknext()">
                                submit
                            </a>
                            <script>

                                function clicknext() {
                                    var CreateDate = $(" input[ name='CreateDate' ] ").val();
                                    var DeviceId = $(" input[name='DeviceId']").val();
                                    var DeviceTroubleDetails = $(" input[ name='DeviceTroubleDetails']").val();
                                    var Police = $(" input[ name='Police']").val();
                                    var PoliceId = $(" input[ name='PoliceId']").val();
                                    var Dept = $(" input[ name='Dept']").val();
                                    var Unit = $(" input[ name='Unit']").val();
                                    var BackupId = $(" input[ name='BackupId']").val();
                                    var Plugin = $(" input[ name='Plugin']").val();
                                    var ReceiveDeviceDate = $(" input[ name='ReceiveDeviceDate']").val();
                                    var Comment = $(" input[ name='Comment']").val();
                                    var File = $(" input[ name='file']").val();
                                    var DeviceTroubleType = $("#single-append-text").val();
                                    var DeviceType = $(".btn").filter(".blue").filter(".active").children().val();

                                    var type = "";

                                    if(parent.$("#checkSdvId").val() !== ""){
                                        type = "PUT"
                                    } else {
                                        type = "POST"
                                    }

                                    $.ajax({
                                        type: type,
                                        url: "/sdvmodal",
                                        data: {
                                            Id : type === "PUT" ? id : "",
                                            CreateDate : CreateDate,
                                            DeviceId :DeviceId,
                                            DeviceTroubleDetails : DeviceTroubleDetails,
                                            Police : Police,
                                            PoliceId : PoliceId,
                                            Dept : Dept,
                                            Unit : Unit,
                                            BackupId : BackupId,
                                            Plugin : Plugin,
                                            ReceiveDeviceDate : ReceiveDeviceDate,
                                            Comment : Comment,
                                            DeviceTroubleType : DeviceTroubleType,
                                            DeviceType : DeviceType,
                                            File : File
                                        },
                                        dataType: "json",
                                        //contentType : "multipart/form-data",
                                        success: function(data){
                                            console.log(data);
                                            /*if(data === true){
                                                console.log("1235");

                                                window.parent.location.reload();
                                                $.get("/sdvs")
                                            }*/
                                        }
                                    });
                                }
                            </script>
                        </div>
                    </div>
                </div>
            </div>
        </form>
    </div>
</div>
<!--<script src="/static/js/amazeui.min.js"></script>-->
<!--<script src="/static/js/amazeui.datatables.min.js"></script>-->
<!--<script src="/static/js/dataTables.responsive.min.js"></script>-->
<!--[if lt IE 9]>
<script src="/static/css/css/plugins/respond.min.js"></script>
<script src="/static/css/css/plugins/excanvas.min.js"></script>
<script src="/static/css/css/plugins/ie8.fix.min.js"></script>
<![endif]-->
<!-- BEGIN CORE PLUGINS -->
<script src="/static/css/css/plugins/jquery.min.js" type="text/javascript"></script>
<script src="/static/css/css/plugins/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<script src="/static/css/css/plugins/js.cookie.min.js" type="text/javascript"></script>
<script src="/static/css/css/plugins/jquery-slimscroll/jquery.slimscroll.min.js" type="text/javascript"></script>
<script src="/static/css/css/plugins/jquery.blockui.min.js" type="text/javascript"></script>
<script src="/static/css/css/plugins/bootstrap-switch/js/bootstrap-switch.min.js" type="text/javascript"></script>
<!-- END CORE PLUGINS -->
<!-- BEGIN PAGE LEVEL PLUGINS -->
<script src="/static/css/css/plugins/select2/js/select2.full.min.js" type="text/javascript"></script>
<script src="/static/css/css/plugins/jquery-validation/js/jquery.validate.min.js" type="text/javascript"></script>
<script src="/static/css/css/plugins/jquery-validation/js/additional-methods.min.js" type="text/javascript"></script>
<script src="/static/js/bootstrap-wizard/jquery.bootstrap.wizard.min.js" type="text/javascript"></script>
<script src="/static/css/css/plugins/moment.min.js"></script>
<script src="/static/css/css/plugins/bootstrap-datepicker/js/bootstrap-datepicker.min.js"></script>
<script src="/static/css/css/plugins/bootstrap-daterangepicker/daterangepicker.min.js"></script>
<script src="/static/css/css/plugins/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script src="/static/css/css/plugins/bootstrap-timepicker/js/bootstrap-timepicker.min.js"></script>
<script src="/static/css/css/plugins/clockface/js/clockface.js"></script>
<script src="/static/js/amazeui.upload.event.js"></script>
<script src="/static/js/amazeui.upload.template.js"></script>
<script src="/static/js/amazeui.upload.js"></script>
<!-- END PAGE LEVEL PLUGINS -->
<!-- BEGIN THEME GLOBAL SCRIPTS -->
<script src="/static/js/js/app.min.js" type="text/javascript"></script>
<!-- END THEME GLOBAL SCRIPTS -->
<!-- BEGIN PAGE LEVEL SCRIPTS -->
<script src="/static/js/js/form-wizard.js" type="text/javascript"></script>
<script src="/static/css/css/plugins/components-date-time-pickers.min.js"></script>
<script src="/static/css/css/plugins/components-select2.min.js"></script>
<!-- END PAGE LEVEL SCRIPTS -->
<!-- BEGIN THEME LAYOUT SCRIPTS -->
<script src="/static/js/js/layouts/layout/scripts/layout.min.js" type="text/javascript"></script>
<script src="/static/js/js/layouts/layout/scripts/demo.min.js" type="text/javascript"></script>
<script src="/static/js/js/layouts/global/scripts/quick-sidebar.min.js" type="text/javascript"></script>
<script src="/static/js/js/layouts/global/scripts/quick-nav.min.js" type="text/javascript"></script>
<script src="/static/js/layer/layer.js"></script>
<script src="/static/css/css/plugins/ui-buttons.min.js"></script>
<!-- END THEME LAYOUT SCRIPTS -->
</body>
</html>